package ir_v3

import "github.com/astaxie/beego/orm"

type Mall struct {
	Id   string `orm:"Column(Id)"`
	Name string `orm:"Column(Name)"`
}

func SelectAllMall() (*[]Mall, error) {
	o := orm.NewOrm()
	o.Using("default")
	malls := new([]Mall)
	_, err := o.Raw("SELECT * FROM d_malls").QueryRows(malls)
	return malls, err
}
func SelectMallByName(name string) (Mall, error) {
	o := orm.NewOrm()
	var mall Mall
	err := o.Raw("SELECT * FROM d_malls WHERE name = ?", name).QueryRow(&mall)
	return mall, err
}
